﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Threading;

namespace Week_2_IDE
{
    public partial class Form1 : Form
    {
        static bool frenchlang = false;
        Form2 obj2 = new Form2();
        public Form1()
        {
            
            InitializeComponent();

            
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            


        }

        private void button4_Click(object sender, EventArgs e)
        {
           obj2.RefToForm1 = this;
            this.Visible = false;
            obj2.Show();
            
        }

        private void BTchangeIcon_Click(object sender, EventArgs e)
        {
           this.Icon = Properties.Resources.Icon2;
            

       }

        

        private void BTchangeLang_Click(object sender, EventArgs e)
        {
            //ChangeLanguage("fr");
            if (!frenchlang)
            {
                ChangeLanguage("fr");
                frenchlang = true;
            }
            else
            {
                ChangeLanguage("en");
                frenchlang = false;
            }
        }
         

        private void ChangeLanguage(string lang)
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources =
                      new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(lang));

                
            }
        }

        private void BTCallClass_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            label1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];
        }

        private void BTResetIcon_Click(object sender, EventArgs e)
        {
            this.Icon = null;
        }

          
                


    }

}
